{any_include file="scp_page_start.tpl" wide=1}

<!-- $Id$ -->

<h1>OAuth - Log</h1>

{any_include file="scp_oauth_menu.tpl"}

<h2>
Log for
{if $smarty.get.osr_consumer_key}server side consumer key “{$smarty.get.osr_consumer_key}”
{elseif $smarty.get.ocr_consumer_key}consumer side consumer key “{$smarty.get.ocr_consumer_key}”
{elseif $smarty.get.ost_token}server side token “{$smarty.get.ost_token}”
{elseif $smarty.get.oct_token}consumer side token “{$smarty.get.oct_token}”
{else}user {any_member}
{/if}
</h2>

{foreach from=$log item='l'}

<br/>
<h2>{$l.timestamp}</h2>

<table style="width: auto">
<tr>
	<th>server side consumer key</th>
	<td><a href="{$rel_path}module/OAuth/log?osr_consumer_key={$l.osr_consumer_key|escape:"url"}">{$l.osr_consumer_key|escape}</a></td>
</tr>
<tr>
	<th>server side token</th>
	<td><a href="{$rel_path}module/OAuth/log?ost_token={$l.ost_token|escape:"url"}">{$l.ost_token|escape}</a></td>
</tr>
<tr>
	<th>consumer side consumer key</th>
	<td><a href="{$rel_path}module/OAuth/log?ocr_consumer_key={$l.ocr_consumer_key|escape:"url"}">{$l.ocr_consumer_key|escape}</a></td>
</tr>
<tr>
	<th>consumer side token</th>
	<td><a href="{$rel_path}module/OAuth/log?oct_token={$l.oct_token|escape:"url"}">{$l.oct_token|escape}</a></td>
</tr>
<tr>
	<th>OAuth base string</th>
	<td>
		<pre style="overflow: auto; width: 800px;">{$l.base_string}</pre>
	</td>
</tr>
</table>

{if strncmp($l.sent, 'POST ', 5) == 0 || strncmp($l.sent, 'GET ', 5) == 0}
<strong>Sent (to other server)</strong>
<pre style="margin: 4px; padding: 4px; border: 1px solid #333; background-color: #eee; overflow: auto">{$l.sent|escape}</pre>
<strong>Received (from other server)</strong>
<pre style="margin: 4px; padding: 4px; border: 1px solid #333; background-color: #eee; overflow: auto">{$l.received|escape}</pre>
{else}
<strong>Request (from consumer)</strong>
<pre style="margin: 4px; padding: 4px; border: 1px solid #333; background-color: #eee; overflow: auto">{$l.received|escape}</pre>
<strong>Replied (to consumer)</strong>
<pre style="margin: 4px; padding: 4px; border: 1px solid #333; background-color: #eee; overflow: auto">{$l.sent|escape}</pre>
{/if}


{if !empty($l.notes)}
<strong>Notes</strong>
<pre style="margin: 4px; padding: 4px; border: 1px solid #333; background-color: #eee; overflow: auto">{$l.notes|escape}</pre>
{/if}

{foreachelse}
<p class="notice">
	Log is empty
</p>
{/foreach}

{any_include file="scp_page_end.tpl" wide=1}
